package com.zh.service.impl;
import java.math.BigDecimal;

import com.zh.pojo.domain.Customer;
import com.zh.pojo.domain.CustomerSummary;
import com.zh.mapper.CustomerSummaryMapper;
import com.zh.service.ICustomerSummaryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 乘客数据汇总 服务实现类
 * </p>
 *
 * @author 初四
 * @since 2024-06-13
 */
@Service
public class CustomerSummaryServiceImpl extends ServiceImpl<CustomerSummaryMapper, CustomerSummary> implements ICustomerSummaryService {

    @Override
    public void saveCustomerSummary(Customer customer) {
        CustomerSummary customerSummary = new CustomerSummary() ;
        customerSummary.setId(customer.getId());
        customerSummary.setTotalOrders(0);
        customerSummary.setTotalFine(BigDecimal.ZERO);
        customerSummary.setVoucherNumbers(0);
        customerSummary.setCancelOrders(0);

        super.save(customerSummary);
    }
}
